<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>后台控制面板</title>
    <meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
    {''|getCommon} 
	{'belatedPNG'|getPlugSingle}
	{'panel/css/panel.css'|getPageCss}
	{'audioPlay'|getPlugSingle}
	{'uiDialog'|getPlugSingle}
	{'uiSelect'|getPlugSingle}
	{'easyui'|getPlugSingle}
	{'uploadify'|getPlugSingle}
	{'ztree'|getPlugSingle}
	{'cookie'|getPlugSingle}
    <link href="{$skinUrl}" rel="stylesheet" type="text/css" id="skinSelected"/>
	<script>		
		window.gMaintime = 0;
		try{
			window.gMaintime = (new Date()).getTime();
		}catch(e){}(
			function(){
				var a = ['header','footer','section','aside','article','nav','hgroup','figure','figcaption','time','mark','output','meter','menus'];
				for(var i=0,m=a.length;i<m;i++){
					document.createElement(a[i]);
				}
			}
		)();
    	var rootMenus = {$rootMenus};
    </script>
    <script type="text/javascript">
    	/**
    	 * @author yukaizhao
    	 */
    	 {literal}
    	$.extend($.fn.validatebox.defaults.rules, {
    	    /*必须和某个字段相等*/
    	    equalTo: {
    	        validator:function(value,param){
    	            return $(param[0]).val() == value;
    	        },
    	        message:'字段不匹配'
    	    }
    	});
    	{/literal}
    	
		var SITE_GLOBAL_URL = '{$smarty.const.SITE_GLOBAL_URL}';
		var sessionId = '{$smarty.cookies.sessionId}';
   	</script>
</head>
<body>
	{literal}
	<div id="giveGlod" class="easyui-dialog" title="赠送野猪币" closed="true" style="width:260px;height:170px;padding:10px"
    	data-options="
				iconCls: 'icon-add',
				buttons: [{
					text:'确认',
					iconCls:'icon-ok',
					handler:function(){
						$('#giveGlod').dialog('close');
						$('#giveGlodForm').form('submit', {
							url : '/manage/panel/Panel/giveGlod',
							onSubmit : function() {  
								return $(this).form('validate');//对数据进行格式化
							},
							success : function(data) {
								eval('var dataJson='+data);
								if(dataJson.result==true){
									$.messager.show({
										title : '提示',
										msg :'赠送成功！'
									});
									$('#myGoldss').text($('#myGoldss').text()-$('#userGolds').val());
								}else{
									$.messager.show({
										title : '提示',
										msg :'赠送失败请重试！'
									});
								}
							}
						});
					}
				},{
					text:'取消',
					handler:function(){
						$('#giveGlod').dialog('close');
					}
				}],
				onResize:function(){
					$(this).dialog('center');
				}
			">
			<form id="giveGlodForm" method="post">
		    	<table cellpadding="5">
		    		<tr>
		    			<td>赠送给:</td>
		    			<td><input id="guserLoginId" class="easyui-textbox" type="text" name="guserLoginId" data-options="required:true,validType:{length:[2,8],isExistLoginId:''}"></input></td>
		    		</tr>
		    		<tr>
		    			<td>野猪币数量:</td>
		    			<td><input id="userGolds" class="easyui-textbox" type="text" name="userGolds" data-options="required:true,validType:{myGoldNumber:''}" ></input></td>
		    		</tr>
		    	</table>
		    </form>
		</div>
	{/literal}
    <header id="divFrameTop">
    	<div class="logo">
        	<a id="logo" href="javascript:void(0)" class="png_bg">
            </a>
        </div>
        <div class="info">
        	<a class="welcome first" href="javascript:void(0)">
            	欢迎光临{$userInfo.userLoginId}({$roles.roleDesc})
            	<b class="arrow"></b>
            </a>
            <span>|</span>
            <a href="javascript:void(0)" id="faceselected" url="faceselected/faceselected.html">换肤</a>
            <span>|</span>
            <a href="javascript:void(0)" id="exitSystem" class="last">退出</a>
        </div>
        <div id="ui-msg-account">
            <div class="row">
                用户帐号：{$userInfo.userLoginId}
            </div>
            <div class="row sound">
                当前音效状态:<s>开启</s>&nbsp;&nbsp;<img src="images/disc.gif" width="16" height="12" class="open-sound png_bg" align="absmiddle"/><a href="javascript:void(0)" class="changeStateSound open">切换状态</a>
            </div>
            <div class="row last">
                <a href="javascript:updateUserPwd({$userInfo.userId});">密码修改</a>
            </div>
            <div class="top-line"></div>
            <div class="link"></div>
            <div class="bottom-line"></div>
        </div>
        <div class="search">
        	<div type="text" class="text">
            	<label>搜索模块</label>
                <input class="ins" type="text"/>
                <div class="arrow"></div>
            </div>
            <div class="btn">
            	<div class="ico png_bg"></div>
            </div>
        </div>
        <menus class="menus">
        	<ul>
                
            </ul>
        </menus>
        <div class="line"></div>
        <div class="status">加载中...</div>
        <div class="op-result">邮箱皮肤设置成功</div>
    </header>
    <div id="menus_op_tab_options">
        <div class="menuitem">
            <div class="icon close"></div>
            关闭全部
        </div>
        <div class="dividing-line"></div>
        <div class="menuitem">
            首页
        </div>
        <div class="menuitem">
            管理中心
        </div>
        <div class="menuitem">
            收件箱
        </div>
    </div>
    <div id="serach-menu" class="ztree">
    	
    </div>
    <section id="frame-main">
    	<div id="divFrameMainNav">
        	<ul class="main-nav">
            </ul>
        </div>
        <section id="secContent">
            <div class="secContentPage" url="index/index.html">
            	<div class="index-left">
                    <div class="main">
                        <div class="title">欢迎{$userInfo.userLoginId}({$roles.roleDesc})来到营销管理系统，希望你有全新的体验。</div>
                        <div class="last-login">
                            <font>我的野猪币：</font><span id="myGoldss">{$userGold.userGold}</span>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="giveGold();">赠送</a>
                           <a href="javascript:updatePwd();" style="margin-left:50px">密码修改</a>
                           <a href="#" class="easyui-linkbutton" iconCls="icon-reload" plain="true" style="margin-left:20px" onclick="javascript:window.location.reload()">刷新</a>
                        </div>
                     	 <div class="">
                     	 		<table id="userTable" title="最近收入明细" style="width:100%;"
										data-options="url:'/manage/panel/Panel/queryIncomeInfo',method:'post',multiSort:false,singleSelect:true">
									<thead>
										<tr>
											<th data-options="field:'userInFId'" width="10%">收入明细ID</th>
											<th data-options="field:'userInFLoginId'" width="10%">收入人</th>
											<th data-options="field:'roleDesc'" width="10%">角色</th>
											<th data-options="field:'userInFMo'" width="10%">收入金额</th>
											<th data-options="field:'userInFOthMo',align:'left'" width="10%">额外收入金额</th>
											<th data-options="field:'userInFCreatetime',align:'left'" width="17%">收入时间</th>
											<th data-options="field:'userInFType',align:'left',formatter:incomeType" width="12%">收入人类型</th>
											<th data-options="field:'userInFReason',align:'left',formatter:incomeReasons" width="20%" >收入事由</th>
										</tr>
									</thead>
								</table>
							
                     	 </div>
                       
                
                    </div>
                </div>
            </div>
            <div class="secContentPage" url="faceselected/faceselected.html" style="display:none;">
            	<div class="face-cate">
                    <div class="title">主题皮肤</div>
                    <div class="faces">
                        <div class="face" url="manage/style/page/panel/skin/pinkskin/css/skin.css">
                            <div class="img-frame">
                                <div class="img i1"></div>
                            </div>
                            <div class="desc">可爱女生</div>
                        </div>
                        <div class="auto-height"></div>
                    </div>
                    <div class="auto-height"></div>
                </div>
                <div class="face-cate">
                    <div class="title">基础皮肤</div>
                    <div class="faces">
                        <div class="face" url="manage/style/page/panel/skin/greenskin/css/skin.css">
                            <div class="img-frame">
                                <div class="img i3"></div>
                            </div>
                            <div class="desc">清新绿(默认)</div>
                        </div>
                        <div class="face" url="manage/style/page/panel/skin/violetskin/css/skin.css">
                            <div class="img-frame">
                                <div class="img i4"></div>
                            </div>
                            <div class="desc">尊贵紫</div>
                        </div>
                        <div class="face" url="manage/style/page/panel/skin/goldenskin/css/skin.css">
                            <div class="img-frame">
                                <div class="img i5"></div>
                            </div>
                            <div class="desc">贵族金</div>
                        </div>
                        <div class="face" url="manage/style/page/panel/css/manage.css">
                            <div class="img-frame">
                                <div class="img i2"></div>
                            </div>
                            <div class="desc">天空蓝</div>
                        </div>
                        <div class="auto-height"></div>
                    </div>
                    <div class="auto-height"></div>
                </div>
            </div>
        </section>
    </section> 
    <footer id="footer">
    	<div class="skin-item skin-top"></div>
        <div class="skin-item skin-top-left"></div>
        <div class="skin-item skin-top-right"></div>
        <div class="skin-item skin-left"></div>
        <div class="skin-item skin-left-top"></div>
        <div class="skin-item skin-right"></div>
        <div class="skin-item skin-right-hack"></div>
        <div class="skin-item skin-bottom"></div>
        <div class="skin-item skin-bottom-left"></div>
        <div class="skin-item skin-bottom-right"></div>
        <div id="skinFullScreen" class="skin-item skin-fullScreen"></div>
    </footer>
    <script type="text/javascript">
    	
    </script>
    <!--添加资讯-->
    <div class="ui-msgbox-normal" id="inputInfoDiv">
    	<div class="ui-form">
        	<div class="ui-form-title">输入邮件夹名称</div>
            <div class="ui-form-text">
            	<div class="input-frame">
                	<input type="text" name="mailFolder"/>
                </div>
            </div>
            <div class="auto-height"></div>
        </div>
    </div>
    {'index/addInput.js'|getPageJs}
    <!--确认框-->
    <div class="ui-msgbox-confirm" id="confirmUI">
    	<span class="ui-msgbox-confirm-ico"></span>
        <div class="ui-msgbox-confirm-text">
        	<div class="ui-msgbox-confirm-title">确认删除该邮件夹</div>
            您确定要彻底"删除"当前选择的邮件夹吗？
        </div>
        <div class="auto-height"></div>
    </div>
    <div id="flexBtn" class="open">
    	<b class="png_bg"></b>
    </div>
    <div id="updateUserPwd" class="easyui-dialog" title="修改用户密码" closed="true" style="width:260px;height:170px;padding:10px"
   	data-options="
			iconCls: 'icon-add',
			buttons: [{
				text:'确认',
				iconCls:'icon-ok',
				handler:function(){
					$('#updateUserPwdForm').form('submit', {
						url : '/manage/systemmanage/systemusermanage/UserManage/updateUserInfo',
						onSubmit : function() {
							return $(this).form('validate');//对数据进行格式化
						},
						success : function(data) {
							eval('var dataJson='+data);
							if(dataJson.result==true){
								$.messager.show({
									title : '提示',
									msg :'您已成功修改该用户密码!'
								});
								$('#updateUserPwd').dialog('close');
							}else{
								$.messager.show({
									title : '提示',
									msg :'修改失败请重试！'
								});
							}
						}
					});
				}
			},{
				text:'取消',
				handler:function(){
					$('#updateUserPwd').dialog('close');
				}
			}],
			onResize:function(){
				$(this).dialog('center');
			}
		">
		<form id="updateUserPwdForm" method="post">
	    	<table cellpadding="5">
	    		<tr>
	    			<td>输入密码:</td>
	    			<td><input type="hidden" name="userId"/><input id="password2" class="easyui-textbox" type="password" name="userPwd" data-options="required:true,validType:'length[6,20]'"></input></td>
	    		</tr>
	    		<tr>
	    			<td>确认密码:</td>
	    			<td><input id="repassword2" class="easyui-textbox" type="password" name="subject" data-options="required:true" validType="equalTo['#password2']" invalidMessage="两次输入密码不匹配"></input></td>
	    		</tr>
	    	</table>
	    </form>
	</div>
    <div id="updatePwd" class="easyui-dialog" title="修改密码" closed="true" style="width:260px;height:170px;padding:10px"
   	data-options="
			iconCls: 'icon-add',
			buttons: [{
				text:'确认',
				iconCls:'icon-ok',
				handler:function(){
					$('#updatePwdForm').form('submit', {
						url : '/manage/panel/Panel/updatePwd',
						onSubmit : function() {
							return $(this).form('validate');//对数据进行格式化
						},
						success : function(data) {
							eval('var dataJson='+data);
							if(dataJson.result==true){
								$.messager.show({
									title : '提示',
									msg :'修改密码成功!'
								});
								$('#updatePwd').dialog('close');
							}else{
								$.messager.show({
									title : '提示',
									msg :'修改失败请重试！'
								});
							}
						}
					});
				}
			},{
				text:'取消',
				handler:function(){
					$('#updatePwd').dialog('close');
				}
			}],
			onResize:function(){
				$(this).dialog('center');
			}
		">
		<form id="updatePwdForm" method="post">
	    	<table cellpadding="5">
	    		<tr>
	    			<td>输入密码:</td>
	    			<td><input id="uppwd" class="easyui-textbox" type="password" name="userPwd" data-options="required:true,validType:'length[6,20]'"></input></td>
	    		</tr>
	    		<tr>
	    			<td>确认密码:</td>
	    			<td><input id="reuppwd" class="easyui-textbox" type="password" name="upsubject" data-options="required:true" validType="equalTo['#uppwd']" invalidMessage="两次输入密码不匹配"></input></td>
	    		</tr>
	    	</table>
	    </form>
	</div>
	<div id="updateUser" class="easyui-dialog" title="修改用户" closed="true" style="width:300px;height:450px;padding:10px"
   	data-options="
			iconCls: 'icon-add',
			buttons: [{
				text:'确认',
				iconCls:'icon-ok',
				handler:function(){
					$('#updateUserForm').form('submit', {
						url : '/manage/systemmanage/systemusermanage/UserManage/updateSelfUserInfo',
						onSubmit : function() {
							return $(this).form('validate');//对数据进行格式化
						},
						success : function(data) {
							eval('var dataJson='+data);
							if(dataJson.result==true){
								$.messager.show({
									title : '提示',
									msg :'您已成功修改用户'
								});
								
								$('#updateUser').dialog('close');
							}else{
								$.messager.show({
									title : '提示',
									msg :'修改失败请重试！'
								});
							}
						}
					});
				}
			},{
				text:'取消',
				handler:function(){
					$('#updateUser').dialog('close');
				}
			}],
			onResize:function(){
				$(this).dialog('center');
			}
		">
		<form id="updateUserForm" method="post">
	    	<table cellpadding="5">
	    		<tr>
	    			<td>手机号码:</td>
	    			<td><input type="hidden" name="userId"/><input class="easyui-textbox" type="text" name="userPhone"></input></td>
	    		</tr>
	    		<tr>
	    			<td>电话号码:</td>
	    			<td><input class="easyui-textbox" type="text" name="userTel"></input></td>
	    		</tr>
	    		<tr>
	    			<td>性别:</td>
	    			<td>
	    				<select class="easyui-combobox" panelHeight="auto" name="userSex" data-options="required:true">
	    					<option value="1">男</option>
	    					<option value="2">女</option>
	    					<option value="3">保密</option>
	    				</select>
	    			</td>
	    		</tr>
	    		<tr>
	    			<td>QQ号码:</td>
	    			<td><input class="easyui-textbox" type="text" name="userQQ"></input></td>
	    		</tr>
	    		<tr>
	    			<td>email:</td>
	    			<td><input class="easyui-textbox" type="text" name="userEmail" validType="email"></input></td>
	    		</tr>
	    		<tr>
	    			<td>上传头像:</td>
	    			<td><button id="uploadUpdateAvater" class="uploadAvater" style="height:20px;"></button></td>
	    		</tr>
	    		<tr>
	    			<td>&nbsp;</td>
	    			<td>
	    				<input name="userAvatarId" type="hidden"/>
	    				<div id="showUpdateUserPhoto"></div>
	    			</td>
	    		</tr>
	    	</table>
	    </form>
	</div>
    {'panel/panel.js'|getPageJs}
    <script type="text/javascript">
			{literal}
			//状态解释器
			function incomeType(val,row){
				switch(val){
					case '1':
						return '<span >一级推荐人 </span>';
						break;
					case '2':
						return '<span >二级推荐人 </span>';
						break;
					case '3':
						return '<span >三级推荐人 </span>';
						break;
					case '4':
						return '<span >被报单 </span>';
						break;
					case '5':
						return '<span >指定收益人  </span>';
						break;
					case '6':
						return '<span >其他 </span>';
						break;
					default:
						return '<span >其他</span>';
						break;
				}
			}
			function incomeReasons(val,row){
				switch(val){
					case '1':
						return '<span >升级为会员  </span>';
						break;
					case '2':
						return '<span >直接升级为报单中心用户  </span>';
						break;
					case '3':
						return '<span >普通用户升级为报单用户 </span>';
						break;
					case '4':
						return '<span >作为报单用户获得佣金  </span>';
						break;
					case '5':
						return '<span >指定收益人获得收益  </span>';
						break;
					case '6':
						return '<span >他人赠送  </span>';
						break;
					case '7':
						return '<span >赠送给他人  </span>';
						break;
					case '8':
						return '<span >提现 </span>';
						break;
					case '9':
						return '<span >野猪币消费  </span>';
						break;
					case '10':
						return '<span >提现被拒绝 </span>';
						break;
					case '11':
						return '<span >系统为用户充值</span>';
						break;
					case '12':
						return '<span >10级内推荐人获得1%佣金</span>';
						break;
					default:
						return '<span >其他</span>';
						break;
				}
			}
			
			//修改用户密码
			function giveGold(){
				//打开权限设置弹出框
				$('#giveGlod').dialog('open');
				//先清空后加载
				$('#giveGlodForm').form('clear');
			}
			
			$(function(){
				var pager = $('#userTable').datagrid({
					method: 'POST',
					loadMsg: '数据加载中,请稍候...',
					pagination: false
				}).datagrid('getPager');	// get the pager of datagrid
				pager.pagination({
					
				});			
			})
			{/literal}
		</script>
</body>
</html>